home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
vector.lha
/
vector
/
stack.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-11-23
|
862b
|
32 lines
#ifndef _STACK_H
#define _STACK_H
#include <hmatrix.h>
const int MatrixStackDepth = 20;
class MatrixStack {
HMatrix stack[MatrixStackDepth];// Stack of suspended matrices
HMatrix tos; // Current matrix
HMatrix tosadjoint; // Adjoint of current matrix, if computed
float tosdeterminant; // Determinant of current matrix, if computed
int depth; // # of matrices on stack
int adjointflag; // Is adjoint computed for CTM?
void compute_adjoint(); // Recompute adjoint, determinant
public:
void init() { tos.identity(); depth = 0; adjointflag = 0; }
MatrixStack() { init(); }
MatrixStack(HMatrix &m) : tos(m) { depth = 0; adjointflag = 0; }
HMatrix &ctm() { return tos; }
HMatrix &ctmadjoint();
float ctmdet();
int push();
int pop();
};
#endif /*_STACK_H*/